package com.shidaimanong.demo.calcaver;

import java.util.Arrays;

public class CalcAverage2 {
    public static void main(String[] args) {
        //初始化全班期末考试成绩
        int[] scores = {80,75,99,100,31,60,59,74,90,98};
        //计算总成绩
        int sum = Arrays.stream(scores).sum();
        //计算平均成绩
        double average = (double) sum/scores.length;
        //打印平均成绩
        System.out.println(average);
    }
}
